// 用户管理接口
import request from '@/utils/request';
//登录页
export const checkLogin = (data) => {
  return request(
    {
      url: '/users/checkLogin',
      method: 'post',
      data
    }
  )
}
//添加用户页
export const addAccount = (data) => {
  return request(
    {
      url: 'users/add',
      method: 'post',
      data
    }
  )
}
//用户列表
export const getAccountList = (params) => {
  return request(
    {
      url: 'users/list',
      method: 'get',
      params
    }
  )
}
//删除用户
export const deleteAccount = (params) => {
  return request(
    {
      url: 'users/del',
      method: 'get',
      params
    }
  )
}
//批量删除账号
export const batchdelAccount = (params) => {
  return request(
    {
      url: 'users/batchdel',
      method: 'get',
      params
    }
  )
}
// 修改账号
export const editAccount = (data) => {
  return request({
    url: 'users/edit',
    method: 'post',
    data
  })
}
//修改密码
export const editpassword=(data)=>{
  return request({
    url:'/users/editpwd',
    method:'post',
    data
  })
}
//检查旧密码是否正确
export const checkoldPwdAccount = (params) => {
  return request({
    url: 'users/checkoldpwd',
    method: "get",
    params
  })
}
//获取个人信息
export const getUserInfo = () => {
  return request({
    url: 'users/info',
    method: "get",
  })
}
//上传头像
export const uploadAvatar = (data) => {
  return request({
    url: 'users/avatar_upload',
    method: 'post',
    data
  })
}
//修改用户头像
export const modifyAvatar = (params) => {
  return request(
    {
      url: 'users/avataredit',
      method: 'get',
      params
    }
  )
}